<%@ include file="/common/validate.jsp"%>
<%@ include file="/common/user.jsp"%>
<%
	String uid = input.getDesc("uid");
	List<String> list = stringToList(uid);
	List<Integer> uids = new ArrayList<>();
	for(String str:list) {
		uids.add(Tools.getInt(str));
	}
	Map<Integer, User> userMap =  usersByUids(uids);
	Map<Integer, Map> result = new HashMap<>();
	Set<Integer> keyset = userMap.keySet();
	for (Integer key:keyset) {
		User user = userMap.get(key);
		Map userinfo = new HashMap();
		userinfo.put("name", getDisplayName(user));
		userinfo.put("avatar", getDefaultAvatar(user));
		userinfo.put("uid", user.getId());
		userinfo.put("type", user.getType());
		userinfo.put("title", user.getTitle());
		if (user.getType() == 200)
			userinfo.put("role", Tools.getDesc(user.getJson("role")));
		if (!isEmpty(user.getName()))
			userinfo.put("name", user.getName());
		result.put(key, userinfo);
	}
	msg.put("data", result);
	Tools.encryptPrint(out, msg);
%>